fix deprecated-copy waring. (#675)
This fixes
"formatload.cc:127:40: warning: implicitly-declared
‘Format& Format::operator=(const Format&)’ is deprecated [-Wdeprecated-copy]"
Use default member initializers for FormatOption and Format classes.
This allows the use of the default constructor and simplifies the
creation of parameterized constructors.
Use implicit copy constructor for FormatOption and Format classes.
Note the previous copy constructor for the Format class was not
really a copy constructor, it re-initialized readUseCount and writeUseCount.
This was unnecessary. The only place we want to use the copy constructor is
in FormatLoad::getFormats and the instances to be copied have just been
created with one of the Format constructors so the use counts will be zero.
There are plenty of other opportunities where Qt might detach formatList_
and use the copy constructor. Most of these cases are read accesses and
improved const correctness could eliminate the possiblity, i.e. using
QList::at instead of QList::operator[]. A few of these are modifying an
item on the formatList_, and Qt will insist the copy constructor is available
at compile time even if it is never used at run time.